package cn.lcc.feignclient;

import cn.lcc.domain.User;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserFeignFallBackFactory implements FallbackFactory<UserFeignClient> {
    @Override
    public UserFeignClient create(Throwable throwable) {
        throwable.printStackTrace();
        return  id-> new User(id,"网络异常");

    }
}
